<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>IupLabel</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
<style type="text/css">
.style1 {
	border-width: 0;
}
</style>
</head>
<body>
<div id="navigation">
  <ul>
    <li><a href="#Creation">Creation</a></li>
    <li><a href="#Attributes">Attributes</a></li>
    <li><a href="#Callbacks">Callbacks</a></li>
    <li><a href="#Notes">Notes</a></li>
    <li><a href="#Examples">Examples</a></li>
    <li><a href="#SeeAlso">See Also</a></li>
  </ul>
</div>

<h2>IupLabel</h2>

  <p>
  Creates a label interface element, which displays a separator, a text or an image.</p>

<h3><a name="Creation">Creation</a></h3>
<pre>Ihandle* IupLabel(const char *<strong>title</strong>); [in C]
iup.label{[title = <strong>title</strong>: string]} -&gt; (<strong>elem</strong>: ihandle) [in Lua]
label(<strong>title</strong>) [in LED]</pre>
  <p><b>
  title</b>: Text to be shown on the label. It can be NULL. It will set the 
  TITLE attribute.</p>
  <p>
  <u>Returns:</u> the identifier of the 
  created element, or NULL if an error occurs.</p>

<h3><a name="Attributes">Attributes</a></h3>


  <p><b>ACTIVE</b>:
  The only 
  difference between an active label and an inactive one is its visual feedback. Possible values:
  &quot;YES, 
  &quot;NO&quot;. 
  Default:
  &quot;YES&quot;.</p>
  <p><b>ALIGNMENT</b> (<font SIZE="3">non inheritable</font>):
  horizontal and vertical alignment. Possible values:
  &quot;ALEFT&quot;, &quot;ACENTER&quot; and &quot;ARIGHT&quot;,&nbsp; combined to &quot;ATOP&quot;, &quot;ACENTER&quot; 
  and &quot;ABOTTOM&quot;. 
  Default:
  &quot;ALEFT:ACENTER&quot;. Partial values are also accepted, like &quot;ARIGHT&quot; or 
  &quot;:ATOP&quot;, the other value will be used from the current alignment. In Motif, 
  vertical alignment is restricted to &quot;ACENTER&quot;. (vertical alignment 
	since 3.0)</p>


<p>
<a href="../attrib/iup_bgcolor.html">BGCOLOR</a>: ignored, transparent in all 
systems. Will use the background color of the native parent.</p>


  <p><b>ELLIPSIS</b> [Windows and GTK only]: add an ellipsis: &quot;...&quot; to the text 
  if there is not enough space to render the entire string. Can be &quot;YES&quot; or 
  &quot;NO&quot;. Default: &quot;NO&quot;. (since 3.0) (GTK 2.6)</p>
  <p><a href="../attrib/iup_fgcolor.html">FGCOLOR</a>: Text color. Default: the 
	global attribute DLGFGCOLOR.</p>


  <p><strong>IMAGE</strong> (<font SIZE="3">non inheritable</font>):
  Image name. If set before map defines the behavior of the label to contain an 
  image. The natural size will be size of the image in pixels. Use
	<a href="../func/iupsethandle.html">IupSetHandle</a> or
	<a href="../func/iupsetattributehandle.html">IupSetAttributeHandle</a> to 
	associate an image to a name. See also
	<a href="iupimage.html">IupImage</a>.</p>
  <p><strong>IMINACTIVE</strong> (<font SIZE="3">non inheritable</font>) 
  [GTK and Motif only]:
  Image 
  name of the element when inactive. If it is not defined  then the IMAGE is 
  used and the colors will be replaced by a modified version of the background color creating the disabled effect. 
	GTK will also change the inactive image to look like other inactive objects.</p>
  <p><b>MARKUP</b> [GTK only]: allows the title string to contains pango markup 
  commands. Works only if a mnemonic is NOT defined in the title. Can be &quot;YES&quot; or &quot;NO&quot;. Default: &quot;NO&quot;. </p>
  <p><b>PADDING</b>: internal margin. Works just like the MARGIN attribute of 
  the IupHbox and IupVbox containers, but uses a different name to avoid 
  inheritance problems. Not used when SEPARATOR is used. Default value: &quot;0x0&quot;. 
	(since 3.0)</p>

  <p><b>SEPARATOR </b>(creation only) (<font SIZE="3">non inheritable</font>): 
  Turns the label into a line separator. Possible values: &quot;HORIZONTAL&quot; or 
  &quot;VERTICAL&quot;. When changed before mapping the EXPAND attribute is set to 
  &quot;HORIZONTAL&quot; or &quot;VERTICAL&quot; accordingly.</p>


  <p><a href="../attrib/iup_title.html">TITLE</a> (<font SIZE="3">non inheritable</font>): 
	Label's text. If SEPARATOR or IMAGE are not defined before map, then the 
	default behavior is to contain a text. The label behavior can not be changed 
	after map. The natural size will be larger enough to include all the text in 
	the selected font, even using multiple lines. The '\n' character is accepted 
	for line change. The &quot;&amp;&quot; character can be used to define a mnemonic, the 
	next character will be used as key. Use &quot;&amp;&amp;&quot; to show the &quot;&amp;&quot; character instead of defining a 
	mnemonic. The next control from the label will be activated from any control 
	in the dialog using the &quot;Alt+key&quot; combination. (mnemonic support 
	since 3.0)</p>


  <p><b>WORDWRAP</b> [Windows and GTK only]: enables or disable the wrapping of 
  lines that does not fits in the label. Can be &quot;YES&quot; or &quot;NO&quot;. Default: &quot;NO&quot;.
  <font SIZE="3">Can only set WORDWRAP=YES if ALIGNMENT=ALEFT.
  </font>(since 3.0)</p>
  <blockquote>
    <hr>
</blockquote>
<p>
<a href="../attrib/iup_font.html">FONT</a>,
    <a href="../attrib/iup_expand.html">EXPAND</a>, <a href="../attrib/iup_screenposition.html">SCREENPOSITION</a>, 
<a href="../attrib/iup_position.html">
POSITION</a>, <a href="../attrib/iup_minsize.html">
MINSIZE</a>, <a href="../attrib/iup_maxsize.html">
MAXSIZE</a>,
    <a href="../attrib/iup_wid.html">WID</a>, <a href="../attrib/iup_tip.html">TIP</a>, <a href="../attrib/iup_size.html">SIZE</a>, 
<a href="../attrib/iup_rastersize.html">RASTERSIZE</a>,
    <a href="../attrib/iup_zorder.html">ZORDER</a>, <a href="../attrib/iup_visible.html">VISIBLE</a>: 
also accepted.</p>

<h3><a name="Callbacks">Callbacks</a></h3>

  
  
<p><a href="../call/iup_button_cb.html">BUTTON_CB</a>: Action generated when any 
mouse button is pressed or released. (since 3.3)</p>

  
  
<p><a href="../call/iup_dropfiles_cb.html">DROPFILES_CB</a> [Windows and GTK Only]: Action generated when one or 
  more files are dropped in the element. (since 3.3)</p>

  

  
<p> 
<a href="../call/iup_map_cb.html">MAP_CB</a>, 
<a href="../call/iup_unmap_cb.html">UNMAP_CB</a>, 
<a href="../call/iup_enterwindow_cb.html">ENTERWINDOW_CB</a>,
  <a href="../call/iup_leavewindow_cb.html">LEAVEWINDOW_CB</a>:  common callbacks are 
supported.</p>

<h3><a name="Notes">Notes</a></h3>

<p>Labels with images, texts or line separator can not change its behavior after mapped.  But after 
map the image can be changed for another image, and the text for another text.</p>

<h3><a name="Examples">Examples</a></h3>
<div align="center">
  <center>
  <table border="0" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
    <tr>
      <td height="20" align="right" class="style1">Normal Text Label -</td>
      <td rowspan="5" align="center" bordercolor="#FFFFFF" class="style1">
      <img border="0" src="images/iuplabel.png"></td>
      <td height="20" align="left" class="style1">- Normal Image Label</td>
    </tr>
    <tr>
      <td height="10" align="right" class="style1">Horizontal Separator - </td>
      <td height="10" align="left" class="style1">- Horizontal Separator</td>
    </tr>
    <tr>
      <td height="52" align="right" class="style1">FGCOLOR = &quot;0 0 255&quot;<br>
      ALIGNMENT=&quot;ALEFT:ATOP&quot;</td>
      <td height="52" align="left" class="style1">- (8bpp Image)</td>
    </tr>
    <tr>
      <td height="51" align="right" class="style1">FONT = &quot;Helvetica, 14&quot;<br>
      		ALIGNMENT = &quot;ACENTER:ACENTER&quot;</td>
      <td height="51" align="left" class="style1">- ALIGNMENT = &quot;ACENTER&quot;<br>
&nbsp; (24 bpp Image)</td>
    </tr>
    <tr>
      <td height="51" align="right" class="style1">MARKUP = &quot;YES&quot; (GTK Only)<br>
      ALIGNMENT = &quot;ARIGHT:ABOTTOM&quot;</td>
      <td height="51" align="left" class="style1">- ALIGNMENT = &quot;ARIGHT&quot;<br>
&nbsp; (32 bpp Image)</td>
    </tr>
  </table>
  </center>
</div>
<p><a href="../../examples/">Browse for Example Files</a></p>
<h3><a name="SeeAlso">See Also</a></h3>

<p><a href="iupimage.html">IupImage</a>, <a href="iupbutton.html">IupButton</a>.</p>


</body>

</html>